package guoanmaker.operator.business.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import guoanmaker.operator.helper.common.abstractobj.IdEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/*
 * 2017-12-15 zhouyu
 * 金融项目实体
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="t_personal_finance_project_copy")
public class PersonalFinanceProjectCopy extends IdEntity implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;//项目名称
	private String stage;//项目所处阶段
	private String summary;//项目概述
	private String projectPhoto;//项目规划书的图片路径
	private String concreteSummary;//项目具体概述
	private String prospectus;//项目规划书（路径）
	private String prospectusName;//项目规划书名称
	
	//基本信息
	private BigDecimal financingTarget;//项目融资目标
	private String sellShares;//出让股份
	private BigDecimal financingValuation;//融资估值
	private String roundOfFinancing;//融资轮次
	private String useOfFunds;//资金用途
	private String investmentExitMode;//投资退出方式
	
	//行业信息
	private String industryField;//行业领域
	private String competitiveAdvantageInTheField;//领域竞争优势  competitive_advantage_in_the_field
	private Integer industryRankings;//行业排名
	private BigDecimal marketShare;//市场占有率
	
	//团队信息
	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name = "finance_project_id")
	private List<PersonalFinanceProjectPartner> personalFinanceProjectPartnerList;//创始人和合伙人信息

	//项目信息
	private BigDecimal lastRoundOfValuations;//上一轮估值
	
	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name = "finance_project_id")
	private List<PersonalFppatentTechnology> personalFppatentTechnologyList;//专利技术
	
//	@OneToMany(cascade=CascadeType.REFRESH,fetch=FetchType.LAZY)
//	@JoinColumn(name = "fpfinancing_experience_id")
//	private PersonalFinancingExperience personalFinancingExperience;//融资经历
	
//	@OneToMany(cascade=CascadeType.REFRESH,fetch=FetchType.LAZY)
//	@JoinColumn(name = "fpbusiness_event_awards_id")
//	private PersonalBusinessEventAwards PersonalBusinessEventAwards;//创业赛事奖项

	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name = "finance_project_id")
	private List<PersonalFinancingExperience> personalFinancingExperienceList;//融资经历
	
	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name = "finance_project_id")

	private List<PersonalBusinessEventAwards> personalBusinessEventAwardsList;//创业赛事奖项
	//财务数据
	private BigDecimal nperatingIncomeOfTheLastYear;//上年度营业收入
	private BigDecimal netProfitForThePreviousYear;//上年净利润
	private BigDecimal businessIncomeOfLastMonthAndMonth;//上月月营业收入
	private BigDecimal monthlyNetProfit;//月净利润
	private BigDecimal growthRateOfBusinessIncomeLastMarch;//近三月营业收入增长率
	private BigDecimal netProfitGrowthRateInRecentMarch;//近三月净利润增长率
	private BigDecimal grossProfitRate;//毛利率
	private BigDecimal netInterestRate;//净利率
	private Integer registeredUsers;//注册用户量
	private Integer whetherToStartProfit;//是否开始盈利     （0 否  1是）
	private Integer whetherTheProductIsOnlineOrNot;//产品是否上线    （0否  1是）
	private Integer numberSserviceEnterprises;//服务企业数量
	private BigDecimal customerCost;//获客成本
	private Integer dailyLiving;//日活
	private Integer dailyBrowsing;//日浏览量
	private BigDecimal repurchaseRate;//复购率
	
	
	private String financeProjectNumber;//项目编号数字(七位顺序号.只有审核通过后，才会有编号)
	private Date firstSubmitTime;//首次提交时间
	private Date updateTime;//更新时间
	private Date toExamineTime;//审核时间
	private Integer ifRequired;//必填是否全部填写完毕（0必填项没有填完    1必填项均已填完）
	private Integer status;//该项目的审核状态（0:；已通过   1:已下线   2:已拒绝   3:待发布   4:待审核）
	private Integer importantLevel;//该项目的重要级别(由运营人员设置   1:hot 2:warm 3:cool 4:cold 5:空)
	private String projectOldId;//该项目是原项目的哪一个
	@ManyToOne(cascade=CascadeType.REFRESH,optional=false)
	@JoinColumn(name = "user_id")
	private PersonalUser personalUser;//发布该信息的用户
	
	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name = "finance_project_id")
	private List<OperatorApprovalRecord> operatorApprovalRecordList;//项目审批记录
	
	
	public Object clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		PersonalFinanceProjectCopy stu = null;  
		try{  
			stu = (PersonalFinanceProjectCopy)super.clone();  
		}catch(CloneNotSupportedException e) {  
			e.printStackTrace();  
		}  
		return stu; 
	}
	
	@Override
	public String toString() {
		return "PersonalFinanceProject [name=" + name + ", stage=" + stage + ", summary=" + summary
				+ ", concreteSummary=" + concreteSummary + ", prospectus=" + prospectus + ", financingTarget="
				+ financingTarget + ", sellShares=" + sellShares + ", financingValuation=" + financingValuation
				+ ", roundOfFinancing=" + roundOfFinancing + ", useOfFunds=" + useOfFunds + ", investmentExitMode="
				+ investmentExitMode + ", industryField=" + industryField + ", competitiveAdvantageInTheField="
				+ competitiveAdvantageInTheField + ", industryRankings=" + industryRankings + ", marketShare="
				+ marketShare + ", personalFinanceProjectPartnerList=" + personalFinanceProjectPartnerList
				+ ", lastRoundOfValuations=" + lastRoundOfValuations + ", personalFppatentTechnologyList="
				+ personalFppatentTechnologyList + ", personalFinancingExperienceList="
				+ personalFinancingExperienceList + ", PersonalBusinessEventAwardsList="
				+ personalBusinessEventAwardsList + ", nperatingIncomeOfTheLastYear=" + nperatingIncomeOfTheLastYear
				+ ", netProfitForThePreviousYear=" + netProfitForThePreviousYear
				+ ", businessIncomeOfLastMonthAndMonth=" + businessIncomeOfLastMonthAndMonth + ", monthlyNetProfit="
				+ monthlyNetProfit + ", growthRateOfBusinessIncomeLastMarch=" + growthRateOfBusinessIncomeLastMarch
				+ ", netProfitGrowthRateInRecentMarch=" + netProfitGrowthRateInRecentMarch + ", grossProfitRate="
				+ grossProfitRate + ", netInterestRate=" + netInterestRate + ", registeredUsers=" + registeredUsers
				+ ", whetherToStartProfit=" + whetherToStartProfit + ", whetherTheProductIsOnlineOrNot="
				+ whetherTheProductIsOnlineOrNot + ", numberSserviceEnterprises=" + numberSserviceEnterprises
				+ ", customerCost=" + customerCost + ", dailyLiving=" + dailyLiving + ", dailyBrowsing=" + dailyBrowsing
				+ ", repurchaseRate=" + repurchaseRate + ", financeProjectNumber=" + financeProjectNumber
				+ ", firstSubmitTime=" + firstSubmitTime + ", updateTime=" + updateTime + ", toExamineTime="
				+ toExamineTime + ", ifRequired=" + ifRequired + ", status=" + status + ", importantLevel="
				+ importantLevel + ", personalUser=" + personalUser + "]";
	}
	
	
	
}
